import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { AddressUpdateVO, AddressUpdateForm, AddressUpdateQuery } from '@/api/system/addressUpdate/types';

/**
 * 查询修改物流日志列表
 * @param query
 * @returns {*}
 */

export const listAddressUpdate = (query?: AddressUpdateQuery): AxiosPromise<AddressUpdateVO[]> => {
  return request({
    url: '/system/addressUpdate/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询修改物流日志详细
 * @param id
 */
export const getAddressUpdate = (id: string | number): AxiosPromise<AddressUpdateVO> => {
  return request({
    url: '/system/addressUpdate/' + id,
    method: 'get'
  });
};

/**
 * 新增修改物流日志
 * @param data
 */
export const addAddressUpdate = (data: AddressUpdateForm) => {
  return request({
    url: '/system/addressUpdate',
    method: 'post',
    data: data
  });
};

/**
 * 修改修改物流日志
 * @param data
 */
export const updateAddressUpdate = (data: AddressUpdateForm) => {
  return request({
    url: '/system/addressUpdate',
    method: 'put',
    data: data
  });
};

/**
 * 删除修改物流日志
 * @param id
 */
export const delAddressUpdate = (id: string | number | Array<string | number>) => {
  return request({
    url: '/system/addressUpdate/' + id,
    method: 'delete'
  });
};

/**
 * 通过
 * @param id
 */
export const passUpdate = (param: string | number | Array<string | number>) => {
  return request({
    url: '/system/addressUpdate/pass',
    method: 'get',
    params: param
  });
};

/**
 * 拒绝
 * @param id
 */
export const refuseUpdate = (param: string | number | Array<string | number>) => {
  return request({
    url: '/system/addressUpdate/refuse',
    method: 'get',
    params: param
  });
};
